import fetch from './fetch';
/**
 * 获取推荐课程列表
 */
export function listRecommendCourse(json) {
    const data = {
        ...json.sendData
    }
    var page = json.page || 1;
    var rows = json.rows || 10;
    return fetch({
        url: `/eke/homepage/listRecommendCourse/${page}/${rows}`,
        method: 'post',
        data 
    })
}

/**
 * 推荐老师
 */
export function listRecommendTeachers(json) {
    const data = {
        ...json.sendData
    }
    var page = json.page || 1;
    var rows = json.rows || 10;
    return fetch({
        url: `/eke/homepage/listRecommendTeachers/${page}/${rows}`,
        method: 'post',
        data 
    })
}
/**
 * 推荐j机构
 */
export function listRecommendOrgs(json) {
    const data = {
        ...json.sendData
    }
    var page = json.page || 1;
    var rows = json.rows || 10;
    return fetch({
        url: `/eke/homepage/listRecommendOrgs/${page}/${rows}`,
        method: 'post',
        data 
    })
}

// 全局搜索 searchAll

export function searchAll(json) {
    const data = {
        ...json
    }
    return fetch({
        url: '/eke/homepage/searchAll/',
        method: 'post',
        data 
    })
}

// 获取学段
export function listPeriod(json) {
    const data = {
        ...json
    }
    return fetch({
        url: '/eke/tag/listPeriod',
        method: 'post',
        data 
    })
}

// 获取学科
export function listSubject(json) {
    const data = {
        ...json
    }
    return fetch({
        url: '/eke/tag/listSubject',
        method: 'post',
        data 
    })
}

// 根据学段学科获取知识点 
export function listTag(json) {
    const data = {
        ...json
    }
    return fetch({
        url: '/eke/tag/listTag',
        method: 'post',
        data 
    })
}

//  找课程searchCourse

export function searchCourse(json) {
    const data = {
        ...json.sendData
    }
    var page = json.page || 1;
    var rows = json.rows || 10;
    return fetch({
        url: `/eke/homepage/searchCourse/${page}/${rows}`,
        method: 'post',
        data 
    })
}

// 找老师 /eke/homepage/searchTeacher/1/10
export function searchTeacher(json) {
    global.log(json,'json')
    const data = {
        ...json.sendData
    }
    var page = json.page || 1;
    var rows = json.rows || 10;
    return fetch({
        url: `/eke/homepage/searchTeacher/${page}/${rows}`,
        method: 'post',
        data 
    })
}

 // 找机构 /eke/homepage/searchOrg/1/10
 export function searchOrg(json) {
     const data = {
         ...json.sendData
     }
     var page = json.page || 1;
     var rows = json.rows || 10;
    return fetch({
        url: `/eke/homepage/searchOrg/${page}/${rows}`,
        method: 'post',
        data 
    })
}

// 广告列表  /eke/homepage/listBanner
export function listBanner(json) {
    const data = {
        ...json
    }
    return fetch({
        url: '/eke/homepage/listBanner',
        method: 'post',
        data 
    })
}

